home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
DragClick
/
Sources
/
LayerMgr.h
< prev
next >
Wrap
Text File
|
1996-06-21
|
4KB
|
120 lines
#ifndef __LAYERMGR__
#define __LAYERMGR__
#ifndef __PROCESSES__
#include <Processes.h>
#endif
/* Part of the undocumented Layer Manager structures and calls
* Information found with the help of MacsBug under MacOS 7.0.
* Please note that using this information may make your mac
* explode (hey, this could be a subject for a QuickTime moovie !);
* so use at your own risks, this may break in the future,
* etc.. (usual disclaimeer).
* I only wish that Apple will document this manager in a very near
* future (let's dream...).
*
* What I found was that a layer is associated with each running
* applications (if it has a user-interface), which groups all
* windows of that application. This is how you can hide an application
* (remember 'applications' menu under system 7) and get the list of
* other applications windows. Have fun.
*
* PS : If you have more information on the Layer Manager, please
* let me know! You can join me at hugues@isoft.fr
*/
#define _LayerDispatch 0xA829
typedef WindowPtr LayerPtr;
// This records some information on the process which owns
// the layer... Most of it is not clear (there are pointers
// to other LayerRecords, to a heap zone, etc. in the unknown
// parts)
typedef struct {
long unknown1;
OSType signature;
OSType creator;
char unknown2[24];
ProcessSerialNumber layerPSN;
char unknown3[40];
Handle moreLayerInfo;
} LayerInfo, *LayerInfoPtr;
typedef struct {
GrafPort port;
short windowKind;
Boolean visible;
Boolean hilited;
Boolean metaLayer;
Boolean spareFlag;
RgnHandle strucRgn;
RgnHandle contRgn;
RgnHandle updateRgn;
Handle windowDefProc;
LayerPtr parentLayer;
AuxWinHandle auxWinHead;
short titleWidth;
AuxCtlHandle auxCtlHead;
LayerPtr nextLayer;
WindowPtr windowList;
LayerInfoPtr layerInfo;
} LayerRecord, *LayerPeek;
typedef short WindowActionCode;
enum {
kNextWindow = 0,
kNextLayer = 700,
kBreak
};
typedef pascal WindowActionCode ( *LayerActionProcPtr )(
WindowPtr theWindow, LayerPtr theLayer, long refCon );
#define kAllLayers ((LayerPtr)-1)
// Call the action proc for each window in each layer
pascal WindowActionCode ForEachLayerWindowDo(
LayerPtr layer1, LayerPtr layer2, LayerPtr layer3,
LayerActionProcPtr layerAction, long refCon ) = { 0x70F8, _LayerDispatch
};
// Return the window's layer
pascal LayerPtr WindowLayer( WindowPtr theWindow ) = { 0x70F9,
_LayerDispatch };
// Return the frontmost visible window in the given layer
pascal WindowPtr LayerFrontVisibleWindow( LayerPtr theLayer )
= { 0x70FD, _LayerDispatch };
// Return the frontmost visible window on the desktop
pascal WindowPtr DeskFrontVisibleWindow( void ) = { 0x70FE,
_LayerDispatch };
// Return the desktop's layer (contains all other layers)
pascal LayerPtr DeskLayer( void ) = { 0x70FF, _LayerDispatch };
// Return TRUE if theLayer is really a LayerPtr; return FALSE if it's a WindowPtr
pascal Boolean IsLayer( LayerPtr theLayer ) = { 0x7002, _LayerDispatch };
// Return the current process' layer
pascal LayerPtr CurrentLayer( void ) = { 0x7003, _LayerDispatch };
// Return the first window of this layer.
pascal WindowPtr LayerFrontWindow( LayerPtr theLayer ) = { 0x7006,
_LayerDispatch };
// All-layer version of FindWindow
pascal short FindLayerWindow( Point where, WindowPtr *foundWindow )
= { 0x7007, _LayerDispatch };
#define LayerVisible(aLayer) (((LayerPeek)aLayer)->visible)
#endif